package conversion.service.impl;


import conversion.bean.File;
import conversion.mapper.FileMapper;
import conversion.service.FileService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * 文件操作事务实现类（主数据库）
 */
@Service
public class MysqlFileServiceImpl implements FileService {

    @Resource
    private FileMapper fileMapper;


    @Override
    public List<File> getAllFiles() {
        return fileMapper.getAllFiles();
    }

    @Override
    public List<File> getFilesByValue(String searchValue) {
        return fileMapper.getFilesByValue(searchValue);
    }

    @Override
    public File getFileById(Integer id) {
        return fileMapper.getFileById(id);
    }

    @Override
    public boolean deleteFileById(Integer id) {

        return fileMapper.deleteFileById(id);
    }

    @Override
    public boolean updateFile(File newFile) {

        return fileMapper.updateFile(newFile);
    }

    @Override
    public boolean addFile(File file) {
        return fileMapper.addFile(file);
    }

}

